#ifndef DATA_EXCEPTIONS_H
#define DATA_EXCEPTIONS_H

#include <string>
#include <iostream>
#include "Common/Exceptions/Exception.h"

namespace data {

	class ResourceOpenException : public cmn::Exception {
	public:

		ResourceOpenException( std::string filename ) throw() :
			Exception( "Unable to open resource file " + filename ),
			m_filename( filename ) {
		}

		ResourceOpenException( const ResourceOpenException& orig ) throw() :
			Exception( "Unable to open resource file " + orig.m_filename ),
			m_filename( orig.m_filename ) {
		}

		~ResourceOpenException() throw() {
		}
	private:
		std::string m_filename;
	};

	class ParserException : public cmn::Exception {
	public:

		ParserException( std::string filename, std::string parserMessage ) throw() :
			Exception( "Error while reading resource " + filename + ": " + parserMessage ),
			m_filename( filename ),
			m_parserMessage( parserMessage ) {
			std::cout << "Error while reading resource " << filename << ": " << parserMessage;
		}

		ParserException( const ParserException& orig ) throw() :
			Exception( "Error while reading resource " + orig.m_filename + ": " + orig.m_parserMessage ),
			m_filename( orig.m_filename ),
			m_parserMessage( orig.m_parserMessage ) {
		}

		~ParserException() throw() {
		}

	private:
		std::string m_filename;
		std::string m_parserMessage;
	};
}
#endif
